home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 2
/
Gold Medal Software Volume 2 (Gold Medal) (1994).iso
/
prog
/
tge129c.arj
/
SOURCE.ARJ
/
TGEFONT.H
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-20
|
3KB
|
96 lines
/*****************************************************************************
* The Graphics Engine version 1.29ßC *
* *
* The Graphics Engine code and documentation are Copyright (c) 1993 *
* by Matthew Hildebrand. *
* *
* Unauthorised usage or modification of any or all of The Graphics *
* Engine is strictly prohibited. *
*****************************************************************************/
#ifndef FONTdotH
#define FONTdotH
//*****
//***** Bitmapped font services class
//*****
class Font
{
unsigned charWide, charDeep; // character cell dimensions
unsigned fgColour, bgColour; // font colours (0=invisible)
void far *rawData; // character data here
void far *addrArray[256]; // address of each character
void far *image; // buffer for putImage()
unsigned charSize; // character image size in bytes
public:
Font(char *filename, unsigned char fg=1, unsigned char bg=0);
~Font();
inline int status(void); // return status code (0=ERROR)
unsigned wide(char *str); // string width in pixels
inline unsigned wide(char ch); // character width in pixels
inline unsigned maxWide(void); // max character width in pixels
inline unsigned deep(char *str); // string depth in pixels
inline unsigned deep(char ch); // character depth in pixels
inline unsigned maxDeep(void); // max character depth in pixels
void put(int x, int y, char *str); // write a string
void put(int x, int y, char ch); // write a single character
inline void foreground(unsigned c); // set foreground colour
inline void background(unsigned c); // set background colour
inline unsigned foreground(void); // get foreground colour
inline unsigned background(void); // get background colour
};
inline int Font::status(void)
{
return (rawData==NULL ? 0 : 1);
}
inline unsigned Font::wide(char)
{
return (charWide);
}
inline unsigned Font::maxWide(void)
{
return (charWide);
}
inline unsigned Font::deep(char *)
{
return (charDeep);
}
inline unsigned Font::deep(char)
{
return (charDeep);
}
inline unsigned Font::maxDeep(void)
{
return (charDeep);
}
inline void Font::foreground(unsigned colour)
{
fgColour = colour;
}
inline void Font::background(unsigned colour)
{
bgColour = colour;
}
inline unsigned Font::foreground(void)
{
return (fgColour);
}
inline unsigned Font::background(void)
{
return (bgColour);
}
#endif